﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
					xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
					xmlns:layers="clr-namespace:ArchX.Controls.Layers"
					mc:Ignorable="d" 
					xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
					xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform"
					>
    
	<DataTemplate x:Key="LayerDataTemplate">
		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="Auto" SharedSizeGroup="eye"/>
				<ColumnDefinition Width="Auto" SharedSizeGroup="lock"/>
			</Grid.ColumnDefinitions>
			<Border Grid.ColumnSpan="4" BorderBrush="{Binding Color}" BorderThickness="1" />
			<ContentControl Margin="2">
				<Border Width="20" Height="20" Background="AliceBlue"></Border>
			</ContentControl>
			<layers:EditableTextBlock Grid.Column="1" VerticalAlignment="Center" Content="{Binding Name}"  />

			<CheckBox Grid.Column="2" Margin="2" IsChecked="{Binding IsVisible}">
				<CheckBox.Template>
					<ControlTemplate TargetType="{x:Type CheckBox}" >
						<Grid Background="Transparent">
							<Viewbox Width="22" Height="22">
								<Canvas Width="24" Height="24">
									<Path x:Name="eyeopen" Visibility="Visible" Data="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" Fill="Black" />
									<Path x:Name="eyeclose" Visibility="Hidden" Data="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z" Fill="Black" />
								</Canvas>
							</Viewbox>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="false">
								<Setter TargetName="eyeopen" Property="Visibility"  Value="Hidden" />
								<Setter TargetName="eyeclose" Property="Visibility"  Value="Visible" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</CheckBox.Template>
			</CheckBox>
			<CheckBox Grid.Column="3"  Margin="2" IsChecked="{Binding IsLocked}">
				<CheckBox.Template>
					<ControlTemplate TargetType="{x:Type CheckBox}" >
						<Grid Background="Transparent">
							<Viewbox Width="22" Height="22">
								<Canvas Width="24" Height="24" >
									<Path x:Name="lockopen" Visibility="Visible" Data="M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,1 10,15A2,2 0 0,1 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17Z" Fill="Black" />
									<Path x:Name="lockclose" Visibility="Hidden" Data="M12,17C10.89,17 10,16.1 10,15C10,13.89 10.89,13 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10C4,8.89 4.89,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z" Fill="Black" />
								</Canvas>
							</Viewbox>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter TargetName="lockopen" Property="Visibility"  Value="Hidden" />
								<Setter TargetName="lockclose" Property="Visibility"  Value="Visible" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</CheckBox.Template>
			</CheckBox>
		</Grid>
	</DataTemplate>

	<Style x:Key="LayerItemTemplate" TargetType="ListBoxItem"> 
		<Setter Property="HorizontalContentAlignment" Value="Stretch" /> 
		<Setter Property="Padding" Value="0" /> 
	</Style> 

	<Style x:Key="LayerListBox" TargetType="{x:Type ListBox}">
		<!--<Setter Property="ItemsSource" Value="{d:DesignData /SampleData/LayerItemViewModelCollectionSampleData.xaml}"/>-->
		<Setter Property="ItemTemplate" Value="{DynamicResource LayerDataTemplate}"/>
		<Setter Property="ItemContainerStyle" Value="{DynamicResource LayerItemTemplate}" />
	</Style>

</ResourceDictionary>